sum_net_degree<-function(mynet,vaccinated){
  ggraph<-igraph::graph_from_adjacency_matrix(as.matrix(mynet), weighted=NULL, mode="undirected",
                                              diag=FALSE)
  ggraph <- igraph::delete.vertices(ggraph , which(igraph::degree(ggraph)==0))

  degree.cent <- igraph::degree(ggraph)
#  degree.close<-igraph::closeness(ggraph)
#  degree.btw<-igraph::betweenness(ggraph)
#  degree.eig<-igraph::eigen_centrality(ggraph)

  #Patient 0:
  patient0<-names(sort(igraph::degree(ggraph), decreasing=TRUE))[1]

  n=10
  vaccine_low<-as.data.frame(degree.cent) %>% filter(row.names(.)!=patient0) %>% slice_min( degree.cent,n=n, with_ties=FALSE) %>% row.names()
  vaccine_centr<- as.data.frame(degree.cent) %>% filter(row.names(.)!=patient0) %>% slice_max( degree.cent,n=n, with_ties=FALSE) %>% row.names()
#  vaccine_close<-as.data.frame(degree.close) %>% filter(row.names(.)!=patient0) %>% slice_max( degree.close,n=n, with_ties=FALSE) %>% row.names()
#  vaccine_btw<-as.data.frame(degree.btw) %>% filter(row.names(.)!=patient0) %>% slice_max( degree.btw,n=n, with_ties=FALSE) %>% row.names()
#  vaccine_eig<-as.data.frame(degree.eig$vector) %>% filter(row.names(.)!=patient0) %>% slice_max(degree.eig$vector,n=n, with_ties=FALSE) %>% row.names()
#  if (length(vaccine_eig)<10){
#    vaccine_eig<-as.data.frame(degree.eig$vector) %>% filter(row.names(.)!=patient0) %>% slice_max(degree.eig$vector,n=n+1, with_ties=FALSE) %>% row.names()
#  }

  vulnerable<-vaccine_low

  vaccine_scenarios<-cbind.data.frame("Low Degree"=vaccine_low,"High Degree"=vaccine_centr)

  novaccine<-run_combine_tabs(mynet=mynet,patient0=patient0,vaccinated = NULL, vulnerable=vulnerable)
  vaccine_scenarios<-cbind.data.frame("Low Degree"=vaccine_low,"High Degree"=vaccine_centr)
  mytable<-do.call(rbind,lapply(vaccine_scenarios,run_combine_tabs,mynet=mynet,patient0=patient0, vulnerable=vulnerable))
  mytable<-rbind("No Vaccine"=novaccine,mytable)
  return(mytable)
}


#j<-sum_net_degree(mynet=g.sim[[8]])
#rownames(j)<-c("No Vaccine","","Low Degree","","High Degree","", "High Closeness","", "High Betweenness","")
#j
#j<-sum_net(g.sim[[2]])
